{% extends "base-web.html" %}
{% block content %}
    <div class="tasks">
        <div class="page-header">
            <h3>Analysis Tasks <small>performed, processing and pending analyses</small></h3>
        </div>
        <table class="table table-striped table-bordered">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Category</th>
                    <th style="width: 40%;">Target</th>
                    <th>Added</th>
                    <th>Status</th>
                </tr>
            </thead>
            <tbody>
            {% for row in rows %}
                <tr>
                    <td>{{row.id}}</td>
                    <td>{{row.category|upper}}</td>
                    <td>
                        {% if row.status != "pending" and row.status != "processing" %}
                            <a href="/view/{{row.id}}">
                        {% endif %}
                        <span class="mono">
                            {% if row.category == "file" %}
                                {{row.md5}}
                            {% elif row.category == "url" %}
                                {{row.target}}
                            {% endif %}
                        </span>
                        {% if row.status == "success" %}
                            </a>
                        {% endif %}
                    </td>
                    <td>{{row.added_on}}</td>
                    <td>{{row.status}}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}